#include <pthread.h>
#include <semaphore.h>

class TimeWaiter
{
public:
	TimeWaiter(void);
	~TimeWaiter(void);

	void SyncWait(long t);
	void CancelWait();
	bool IsWaiting();

private:
#ifdef _WINDOWS
	static void* cleanup_mutex(void* param);
#else
	static void cleanup_mutex(void * param);
#endif

private:
	pthread_mutex_t* m_mutex;
	pthread_cond_t* m_cond;
	bool m_wait;
};
